#include <stdio.h>


int diget_sum(int m)
{
	int n = 0;
	while(m)
	{
		 n += m % 10;
		m = m/10;
		
	}	
	return n;
}

int main()
{
	int a =0;
	scanf("%d",&a);
	
	int ret  = diget_sum(a);
	
	printf("%d\n",ret); 
	
	
	return 0; 
 } 
